package com.huawei.hms.aaid.b;

import com.huawei.hms.aaid.HmsInstanceId;
import com.huawei.hms.aaid.constant.a;
import com.huawei.hms.aaid.entity.DeleteTokenResp;
import com.huawei.hms.common.ApiException;
import com.huawei.hms.common.internal.ResponseErrorCode;
import com.huawei.hms.common.internal.TaskApiCall;
import com.huawei.hms.support.api.client.Status;
import com.huawei.hms.support.log.HMSLog;
import com.huawei.hms.utils.JsonUtil;
import o.fjx;

public class b extends TaskApiCall<d, Void> {
    public b(String str, String str2, String str3) {
        super(str, str2, str3);
    }

    protected void doExecute(d dVar, ResponseErrorCode responseErrorCode, String str, fjx<Void> o_fjx_java_lang_Void) {
        if (responseErrorCode.getErrorCode() != 0) {
            HMSLog.e(HmsInstanceId.TAG, "DeleteTokenTask failed, ErrorCode: " + responseErrorCode.getErrorCode());
            o_fjx_java_lang_Void.ॱ(new ApiException(new Status(responseErrorCode.getErrorCode(), responseErrorCode.getErrorReason())));
        } else {
            a a = a.a(((DeleteTokenResp) JsonUtil.jsonToEntity(str, new DeleteTokenResp())).getRetCode());
            if (a != a.a) {
                o_fjx_java_lang_Void.ॱ(a.a(a));
            } else {
                o_fjx_java_lang_Void.ॱ(null);
            }
        }
        com.huawei.hms.aaid.c.b.a(dVar.getContext(), getUri(), responseErrorCode);
    }
}
